package com.droid.lib.controls.demo.widget.tree.demo;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.droid.lib.controls.demo.R;
import com.droid.lib.controls.demo.widget.tree.TreeNode;


/**
 * Created by Bogdan Melnychuk on 2/13/15.
 */
public class ProfileHolders extends TreeNode.BaseNodeViewHolder<TreeItemHolder.TreeItem> {


    public ProfileHolders(Context context) {
        super(context);
    }

    @Override
    public View createNodeView(TreeNode node, TreeItemHolder.TreeItem value) {
        final LayoutInflater inflater = LayoutInflater.from(context);
        final View view = inflater.inflate(R.layout.layout_profile_node, null, false);
        TextView tvValue = (TextView) view.findViewById(R.id.node_value);
        tvValue.setText(value.text);

        final ImageView iconView = (ImageView) view.findViewById(R.id.icon);
        iconView.setImageDrawable(value.icon);

        return view;
    }

    @Override
    public void toggle(boolean active) {
    }

    @Override
    public int getContainerStyle() {
        return R.style.TreeNodeStyleCustom;
    }
}
